/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2024-12-28 11:45:36
 * @LastEditors: aggfb 714740235@qq.com
 * @LastEditTime: 2025-03-01 21:15:22
 * @FilePath: \wire_receiver_collect_box\communication\com_lora.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#ifndef __COM_SCAN_H
#define __COM_SCAN_H

#include <stdint.h>
#include "main.h"

#define FREAME_HANDER_AD 0xAD
#define FREAME_HANDER_DA 0xDA


struct scan_drv_t
{
    uint32_t encode_count; // 编码器数据
    uint8_t color_sensor;  // 颜色传感器
    uint8_t drv_state; // 设备运行状态
    uint32_t line_len; // 线长度
};

#pragma pack(1)
struct scan_senser_drv_t
{
    uint8_t drv1_state; // 设备1 运行状态
    uint32_t drv1_line_len; // 设备1 已收线长度
    uint32_t drv1_box_state; // 设备1 从动盘状态

    uint8_t drv2_state; // 设备2 运行状态
    uint32_t drv2_line_len; // 设备2 已收线长度
    uint32_t drv2_box_state; // 设备2 从动盘状态
};

struct scan_set_info_t
{
    int32_t drv1_stop_line_len; // 设备1 停止收线长度
    int32_t drv1_slow_line_len; // 设备1 减速收线长度

    int32_t drv2_stop_line_len; // 设备2 停止收线长度
    int32_t drv2_slow_line_len; // 设备2 减速收线长度
};

#pragma pack()

extern struct scan_set_info_t scan_set_info;

extern int16_t com_scan_send_change_sensor(void);
extern int16_t com_scan_recv_handle(void);
extern void scan_receive_analysis(uint8_t byte);


#endif
